﻿using System.Windows;

namespace Alimentador.CustomControls
{
    /// <summary>
    /// Interaction logic for WarningPopUp.xaml
    /// </summary>
    public partial class WarningPopUp : Window
    {

        public delegate void ProgressEvent();

        public event ProgressEvent YesPressed;
        public event ProgressEvent NoPressed;

        public bool PositiveSelection = false;

        public WarningPopUp()
        {
            InitializeComponent();
        }

        public string SetMessage
        {
            set
            {
                Title_tb.Text = value;
            }
            get
            {
                return Title_tb.Text;
            }
        }

        private void YesBtn_Click(object sender, RoutedEventArgs e)
        {
            if (YesPressed != null)
            {
                YesPressed();
            }
            PositiveSelection = true;
            Close();
        }

        private void NoBtn_Click(object sender, RoutedEventArgs e)
        {
            if (NoPressed != null)
            {
                NoPressed();
            }
            PositiveSelection = false;
            Close();
        }

        
    }

}
